package com.haoshuang.zhouzhoubang.ui.page.mine.notice.member

import com.haoshuang.zhouzhoubang.databinding.ItemPublishNoticeChooseMemberBinding
import com.haoshuang.zhouzhoubang.model.bean.GroupBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.load
import com.mufeng.libs.utils.view.visibleOrGone


/**
 * 
 */
class PublishNoticeChooseMemberAdapter(data: MutableList<GroupBean.AllPeople>) : BaseBindingQuickAdapter<GroupBean.AllPeople, ItemPublishNoticeChooseMemberBinding>(data) {
    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: GroupBean.AllPeople?) {
        holder.getViewBinding<ItemPublishNoticeChooseMemberBinding>().apply {
            ivCheck.isSelected = item?.isSelected == true
            rivHead.load(item?.avatar)
            tvName.text = item?.nickname
            tvPhone.text = item?.phone

            viewLine.visibleOrGone(position != itemCount - 1)
        }
    }

}